	{% include "../includes/head.html" %}
	<body>
		{% include "../includes/header.html" %}
		
		{% include "../includes/navbar.html" %}
		
		<div class="content">
		
			<div>Quiz: <b>{{ quiz.title }}</b></div>
			{% if questions %}
				{% if isowner %}<div><a href="/addquestion?quiz={{ quiz.key }}">Add question</a></div>{% endif %}
				<br>
				<div><b>Questions {{ first|add:1 }}-{{ last }}</b>
				{% if not atfirst %}<a href="/questions?quiz={{ quiz.key }}&first={{ previous }}"><span class="arrows"><</span>Previous {{ count }}</a>{% endif %}
				{% if not atlast %}<a href="/questions?quiz={{ quiz.key }}&first={{ first|add:count }}">Next {{ count }}<span class="arrows">></span></a>{% endif %}
				</div>
				<table>
				<tr align="left">
				<th>Number</th>
				<th>Question</th>
				<th>Type</th>
				<th>Comments</th>
				<th>Actions</th>
				</tr>
				{% for question in questions %}
					<tr {% if forloop.counter|divisibleby:2 %}class="evenrow"{% endif %}>
					<td>{{ forloop.counter|add:first }}</td>
					<td>{{ question.text|striptags }}</td>
					<td nowrap>
						{% ifequal question.type "MCSR" %}Multiple Choice Single Response{% endifequal %}
						{% ifequal question.type "MCMR" %}Multiple Choice Multiple Responses{% endifequal %}
						{% ifequal question.type "FIB" %}Fill In The Blank{% endifequal %}
					</td>
					<td>{{ question.comment_count }}</td>
					<td nowrap>
						{% if isowner %}<a href="/editquestion?question={{ question.key }}">Edit</a>{% endif %}
						<a href="/comments?question={{ question.key }}">Comments</a>
						<a href="/copyquestion?question={{ question.key }}">Copy</a>
						{% if isowner %}<a href="/movequestion?question={{ question.key }}">Move</a>{% endif %}
						{% if isowner %}<a href="/delete?question={{ question.key }}">Delete</a>{% endif %}
					</td>
					</tr>
				{% endfor %}
				<tr><td colspan="5" align="right">
				<div><b>Questions {{ first|add:1 }}-{{ last }}</b>
				{% if not atfirst %}<a href="/questions?quiz={{ quiz.key }}&first={{ previous }}"><span class="arrows"><</span>Previous {{ count }}</a>{% endif %}
				{% if not atlast %}<a href="/questions?quiz={{ quiz.key }}&first={{ first|add:count }}">Next {{ count }}<span class="arrows">></span></a>{% endif %}
				</div>
				</td></tr>
		
				</table>
			{% endif %}
			
			{% if isowner %}
			<div>
				<br><a href="/addquestion?quiz={{ quiz.key }}">Add question</a></div>{% endif %}
			</div>
		</div>
	</body>
</html>